package patternmining.model.construction;


import patternmining.model.graph.VertexType;
import patternmining.model.graph.EdgeType;

/**
 * 
 * @version 1.0, 06.05.2008
 * @author Holger Wiehen
 */
class TypeMatcher {

   public static VertexType termTypeToVertexType(BPSLTermType termType){
        VertexType vertexType = null;
        switch (termType){
            case CLASS :    vertexType = VertexType.CLASS;
                            break;
            case METHOD :   vertexType = VertexType.METHOD;
                            break;
            case TYPEDVARIABLE: vertexType = VertexType.TYPEDVARIABLE;        
        }
        return vertexType;
    }
    
   public static EdgeType predicateTypeToEdgeType( BPSLPredicateType bpslPredicate ){
       EdgeType edgeType = null;
       switch (bpslPredicate){
           case DefinedIn : edgeType = EdgeType.DEFINED_IN;
                            break;
           case ReferenceToOne : edgeType = EdgeType.REFERENCE_TO_ONE;
                            break;
           case ReferenceToMany : edgeType = EdgeType.REFERENCE_TO_MANY;
                            break;
           case Inheritance : edgeType = edgeType.INHERITANCE;
                            break;
           case Creation :  edgeType = EdgeType.CREATION;
                            break;
           case Invocation : edgeType = EdgeType.INVOCATION;
                            break;
           case Argument :  edgeType = EdgeType.ARGUMENT;
                            break;
           case ReturnType : edgeType = EdgeType.RETURN_TYPE;
       }
       return edgeType;
   }
   
}
